#include <iostream>
using namespace std;

typedef struct _Student{
    int id;
    string name;
    int score;
}stu_t;

int main(int argc, const char *argv[]){
    // 分配空间
    stu_t *p = new stu_t[5];
    // 在终端赋值
    cout << "请输入5个学员的信息(学号 姓名 成绩):" << endl;
    for(int i = 0; i < 5; i++){
        cin >> p[i].id >> p[i].name >> p[i].score;
    }
    // 找成绩最高的学员的下标
    int max_index = 0;
    for(int i = 1; i < 5; i++){
        if(p[i].score > p[max_index].score){
            max_index = i;
        }
    }
    // 输出
    cout << "最高分的同学是:" << endl;
    cout << p[max_index].id << "  " << p[max_index].name << "  " << p[max_index].score << endl;

    // 释放空间
    delete []p;
    p = nullptr;

    return 0;
}